import java.util.Stack;

public class Test {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);
        stack.push(23);
        stack.push(34);

        
    }
    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(12);//入栈
        stack.push(23);
        stack.push(34);
        stack.push(45);
        int x = stack.pop();
        System.out.println();
        x = stack.pop();
        System.out.println(x);
        x = stack.peek();//获取栈顶元素 但是不删除
        System.out.println(x);
        x = stack.pop();//弹出一个元素 并且删除
        System.out.println(x);

        boolean flg = stack.empty();
        System.out.println(flg);
        stack.pop();//12;
        flg = stack.empty();
        System.out.println(flg);
    }
}
